﻿// Decompiled with JetBrains decompiler
// Type: BUTR.DependencyInjection.Extensions.ServiceCollectionExtensions
// Assembly: MCMv5, Version=5.10.2.0, Culture=neutral, PublicKeyToken=null
// MVID: 7AB326B9-B2B4-41C2-9177-68E944071101
// Assembly location: D:\steam\steamapps\workshop\content\261550\2859238197\bin\Win64_Shipping_Client\MCMv5.dll

using System;

#nullable enable
namespace BUTR.DependencyInjection.Extensions
{
  public static class ServiceCollectionExtensions
  {
    internal static WithHistoryGenericServiceContainer ServiceContainer;

    public static IGenericServiceContainer AddSingleton<TService>(
      this IGenericServiceContainer services)
      where TService : class
    {
      services.RegisterSingleton<TService>();
      return services;
    }

    public static IGenericServiceContainer AddSingleton<TService>(
      this IGenericServiceContainer services,
      Func<IGenericServiceFactory, TService> factory)
      where TService : class
    {
      services.RegisterSingleton<TService>(factory);
      return services;
    }

    public static IGenericServiceContainer AddSingleton<TService, TImplementation>(
      this IGenericServiceContainer services)
      where TService : class
      where TImplementation : class, TService
    {
      services.RegisterSingleton<TService, TImplementation>();
      return services;
    }

    public static IGenericServiceContainer AddSingleton<TService, TImplementation>(
      this IGenericServiceContainer services,
      Func<IGenericServiceFactory, TService> factory)
      where TService : class
    {
      services.RegisterSingleton<TService>(factory);
      return services;
    }

    public static IGenericServiceContainer AddSingleton(
      this IGenericServiceContainer services,
      Type serviceType,
      Type implementationType)
    {
      services.RegisterSingleton(serviceType, implementationType);
      return services;
    }

    public static IGenericServiceContainer AddSingleton(
      this IGenericServiceContainer services,
      Type serviceType,
      Func<object> factory)
    {
      services.RegisterSingleton(serviceType, factory);
      return services;
    }

    public static IGenericServiceContainer AddScoped<TService>(
      this IGenericServiceContainer services)
      where TService : class
    {
      services.RegisterScoped<TService>();
      return services;
    }

    public static IGenericServiceContainer AddScoped<TService, TImplementation>(
      this IGenericServiceContainer services)
      where TService : class
      where TImplementation : class, TService
    {
      services.RegisterScoped<TService, TImplementation>();
      return services;
    }

    public static IGenericServiceContainer AddScoped<TService>(
      this IGenericServiceContainer services,
      Func<IGenericServiceFactory, TService> factory)
      where TService : class
    {
      services.RegisterScoped<TService>(factory);
      return services;
    }

    public static IGenericServiceContainer AddScoped<TService, TImplementation>(
      this IGenericServiceContainer services,
      Func<IGenericServiceFactory, TService> factory)
      where TService : class
    {
      services.RegisterScoped<TService>(factory);
      return services;
    }

    public static IGenericServiceContainer AddScoped(
      this IGenericServiceContainer services,
      Type serviceType,
      Type implementationType)
    {
      services.RegisterScoped(serviceType, implementationType);
      return services;
    }

    public static IGenericServiceContainer AddScoped(
      this IGenericServiceContainer services,
      Type serviceType,
      Func<object> factory)
    {
      services.RegisterScoped(serviceType, factory);
      return services;
    }

    public static IGenericServiceContainer AddTransient<TService>(
      this IGenericServiceContainer services)
      where TService : class
    {
      services.RegisterTransient<TService>();
      return services;
    }

    public static IGenericServiceContainer AddTransient<TService, TImplementation>(
      this IGenericServiceContainer services)
      where TService : class
      where TImplementation : class, TService
    {
      services.RegisterTransient<TService, TImplementation>();
      return services;
    }

    public static IGenericServiceContainer AddTransient<TService>(
      this IGenericServiceContainer services,
      Func<IGenericServiceFactory, TService> factory)
      where TService : class
    {
      services.RegisterTransient<TService>(factory);
      return services;
    }

    public static IGenericServiceContainer AddTransient<TService, TImplementation>(
      this IGenericServiceContainer services,
      Func<IGenericServiceFactory, TService> factory)
      where TService : class
    {
      services.RegisterTransient<TService>(factory);
      return services;
    }

    public static IGenericServiceContainer AddTransient(
      this IGenericServiceContainer services,
      Type serviceType,
      Type implementationType)
    {
      services.RegisterTransient(serviceType, implementationType);
      return services;
    }

    public static IGenericServiceContainer AddTransient(
      this IGenericServiceContainer services,
      Type serviceType,
      Func<object> factory)
    {
      services.RegisterTransient(serviceType, factory);
      return services;
    }
  }
}
